package com.meilingcloud.biobank.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.meilingcloud.system.domain.SysAttach;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class SampleCreateSaveDto {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long sourceId;
    @NotBlank(message = "样本源编号不能为空")
    private String sourceCode;
    @NotBlank(message = "样本源名称不能为空")
    private String sourceName;
    private String followState;
    @NotNull(message = "样本源类型不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sourceTypeId;
    // 样本源描述
    private String sourceDesc;
    // 附件
    private List<SysAttach> attaches;
    private String formKey;
    private String formDesc;
    private String formData;

    @NotNull(message = "样本编号不能为空")
    private String sampCode;
    @NotNull(message = "样本类型不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampTypeId;
    @NotNull(message = "样本组不能为空")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampGroupId;
    // 样本量
    private BigDecimal sampQuantity;
    // 样本单位
    private String sampUnit;
    @NotNull(message = "备份数量不能为空")
    @Min(value = 1, message = "备份数量必须大于等于1")
    private Integer sampBackupCount;
    private String tubeType;
    // 采样时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date samplingTime;
    // 动态表单
    private FormDataSaveDto formDataSaveDto;

}
